﻿/*-------------------------------------
//
//Copyright (C) 2007 开发二组 版权所有。
//
//文件名：AdminLeft.aspx.cs
//
//文件功能描述：根据登录用户的角色显示用户控件
// 
//创建标识：2007.11.21 殷悦
//创建描述：
//------------------------------------*/
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// 后台页面左框架集，菜单栏
/// </summary>
public partial class AdminLeft : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.MenuStaff1.Visible = true;
        this.MenuStaffInfo1.Visible = true;
        this.MenuProduct1.Visible = true;
        this.MenuNotes1.Visible = true;
        this.MenuInvoice1.Visible = true;

        //if (Convert.ToInt32(Session["RoleID"]) == 1)
        if(User.IsInRole("1"))
        {//如果用户角色是仓库管理员
            this.MenuStaff1.Visible =false;
            this.MenuStaffInfo1.Visible = true;
            this.MenuProduct1.Visible = true;
            this.MenuNotes1.Visible = false;
            this.MenuInvoice1.Visible = true;
        }
        //if (Convert.ToInt32(Session["RoleID"]) == 2)
        if(User.IsInRole("2"))
        {//如果用户是业务员
            this.MenuStaff1.Visible = false;
            this.MenuStaffInfo1.Visible = true;
            this.MenuProduct1.Visible = false;
            this.MenuNotes1.Visible = true;
            this.MenuInvoice1.Visible = false;
        }
    } 
}
